from django.contrib import admin
from .models import Permission, User

# Register your models here.

# 定义一个模型类的管理类
class PermissionManager(admin.ModelAdmin):
    # 显示哪些字段
    list_display = ['id', 'name', 'code_name', 'type_name']
    list_display_links = ['id', ]
    # 可直接编辑的字段，不能是第一个
    list_editable = ['name', 'code_name']
    list_filter = ['type_name', ]
    search_fields = ['type_name', ]

admin.site.register(Permission, PermissionManager)

admin.site.register(User)






